package edu.sysu.demo.rabbitmq.serial;

import com.esotericsoftware.kryo.Kryo;
import java.util.function.Supplier;

class ThreadLocalKryoSerializer extends KryoSerializer {

  private ThreadLocal<Kryo> threadLocal = ThreadLocal.withInitial(Kryo::new);

  @Override
  protected Supplier<Kryo> kryo() {
    return () -> threadLocal.get();
  }
}
